package com.hejl.controller;


import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Hejl
 * @version 1.0
 * @description
 * @className DeepSeekController
 * @date 2025/6/9 1:43
 */
@RestController
public class DeepSeekController {

    @Autowired
    private OpenAiChatModel chatModel;

    @GetMapping(value = "/ai/hello")
    public String hello(@RequestParam(value = "prompt", defaultValue = "你好，请用中文回答") String prompt) {
        String result = chatModel.call(prompt);
        System.out.println("AI Response: " + result);
        return result;
    }




}